home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tricks of the Mac Game Programming Gurus
/
TricksOfTheMacGameProgrammingGurus.iso
/
Information
/
CSMP Digest
/
volume 1
/
csmp-v1-216.txt
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
NeXTSTEP
RISC OS/Acorn
UTF-8
Wrap
Text File
|
1994-12-08
|
44.5 KB
|
1,254 lines
|
[
TEXT/R*ch
]
C.S.M.P. Digest Sun, 22 Nov 92 Volume 1 : Issue 216
Today's Topics:
Suppl. Gestalt Selector List (Oct 21)
Undoc. gestalt selector list
Code-Resources
'sysz' resource
Problem w/ Sys7 Popup Menus
Registering Gestalt Selectors
RTF format?
Changing open resource files
The Comp.Sys.Mac.Programmer Digest is moderated by Michael A. Kelly.
The digest is a collection of article threads from the internet newsgroup
comp.sys.mac.programmer. It is designed for people who read c.s.m.p. semi-
regularly and want an archive of the discussions. If you don't know what a
newsgroup is, you probably don't have access to it. Ask your systems
administrator(s) for details. You can post articles to any newsgroup by
mailing your article to newsgroup@ucbvax.berkeley.edu. So, to post an
article to comp.sys.mac.programmer, you mail it to
comp-sys-mac-programmer@ucbvax.berkeley.edu. Note the '-' instead of '.'
in the newsgroup name.
Each issue of the digest contains one or more sets of articles (called
threads), with each set corresponding to a 'discussion' of a particular
subject. The articles are not edited; all articles included in this digest
are in their original posted form (as received by our news server at
cs.uoregon.edu). Article threads are not added to the digest until the last
article added to the thread is at least one month old (this is to ensure that
the thread is dead before adding it to the digest). Article threads that
consist of only one message are generally not included in the digest.
The entire digest is available for anonymous ftp from ftp.cs.uoregon.edu
[128.223.8.8] in the directory /pub/mac/csmp-digest. Be sure to read the
file /pub/mac/csmp-digest/README before downloading any files. The most
recent issues are available from sumex-aim.stanford.edu [36.44.0.6] in the
directory /info-mac/digest/csmp. If you don't have ftp capability, the sumex
archive has a mail server; send a message with the text '$MACarch help' (no
quotes) to LISTSERV@ricevm1.rice.edu for more information.
The digest is also available via email. Just send a note saying that you
want to be on the digest mailing list to mkelly@cs.uoregon.edu, and you will
automatically receive each new issue as it is created. Sorry, back issues
are not available through the mailing list.
Send administrative mail to mkelly@cs.uoregon.edu.
-------------------------------------------------------
From: rgaros@bio.vu.nl (Rene G.A. Ros)
Subject: Suppl. Gestalt Selector List (Oct 21)
Date: 21 Oct 92 18:58:49 GMT
Organization: VU Biology, Amsterdam, The Netherlands
Supplemental Gestalt Selector Codes List *
Last updated: Oct., 21 1992 19:40 CET
Supplemental to the selectors listed in the Gestalt Chapter of
Inside Macintosh VI (IM VI), that is.
These can include selectors added by Apple's (system) software or
by software from third parties (your software?).
If a selector code is added by Apple software the entry also
includes if it is an addition to or not listed in IM VI.
I don't have all the documentation or knowledge and I don't want to.
I would like to see this list as a combined effort by different
persons who have together access to a wide area of information.
This list may contain (educated) guesses and perhaps even false
information, so no guarantee is made about the contents.
When there is a reference to a source you may expect there is a
higher probability it is correct.
If you wish to give me more information or correct the information
in this list, please mail me at rgaros@bio.vu.nl
If you read this list in a Usenet group: you can also read it by
using finger to the same address.
Tip: finger rgaros@bio.vu.nl | more
My .plan file which you see when you do this is more up-to-date. I
will post this list to comp.sys.mac.programmer once a month. Or
when (a lot of) information is added/corrected.
CONTENTS
Format used
Gestalt Selector Codes & Responses
Abbreviations
Format 4-byte word version number
Sources
Thanks to
####Format used:
| ****'selector code' (Application [available since version])
| name (description, documentation) OR description
|
| CONST declaration; (remark) *ref.number to source
|
| contradiction:
| source A says "x"
| source B says "y"
Some constant-names may not originate from official publications.
Any bitpattern described is what I or others found
on their machine with their configuration.
####Gestalt Selector Codes & Responses
****'admn' (AppleShare Admin appl [since v3.0?])
gestaltASAdminAttr (not listed in IM VI)
gestaltASAdmin = 'admn';
gestaltASAdminPresent = 0; (present = running, selector
exists when appl has ran,
if still running bit is set)
****'ApoL' (Apollo ext [since v1.0a7])
gestaltINITApolloTable
(response will be published by Jeremy Roussak,
Apollo 1.0 is not yet released.)
****'asps' (AppleShare Print Server appl [since v3.0?])
gestaltASPrintServerAttr (not listed in IM VI)
gestaltASPrintServer = 'asps';
gestaltASPrintServerPresent = 0; (present = running, selector
exists when appl has ran,
if still running bit is set)
****'atkv' (System [since 7.0])
gestaltATalkVersion (see also TN311)
Returns AppleTalk version in 4-byte words
gestaltATalkVersion = 'atkv'; *3
****'AzNe' (NameView cp)
unknown, Table?
****'BSDa' (CloseView cp)
unknown
****'bugz' (System [Tuna Helper]/Tune-up ext)
probably used to communicate between the Tuna Helper
and the Tune-up extension about repaired errors.
The value returned by 1.1.1 is one bit set more
then 1.0.
****'conn' (System)
gestaltConnMgrAttr (addition)
additional responses exist but unknown (bit 2 & 3)
****'cpnt' (QuickTime ext)
gestaltComponentMgrAttr (Component Manager)
gestaltComponentMgr = 'cpnt';
gestaltComponentMgrPresent = 0; (guess)
****'dict' (System [since v7.1])
gestaltDictionaryMgr (System 7.1 Dictionary Manager,
not listed in IM VI)
gestaltDictionaryMgr = 'dict';
new System 7.1 responses exist but unknown
****'eajt' (System)
gestaltEasyAccessJTable (not listed in IM VI)
gestaltEasyAccessJ = 'eajt'; *3
Returns the base address of the Easy Access jump-trap table
****'ESOC' (Serial of Champions ext)
unknown
****'flag' (Network Extension ext)
gestaltFlagshipAttr (not listed in IM VI, see also TN311)
gestaltFlagship = 'flag'; *3
gestaltFlagshipPresent = 0; *3
gestaltFlagshipRegistered = 1; *3
****'fpu ' (System)
gestaltFPUType (addition)
gestal68040FPU = 3; *2
****'fs ' (System)
gestaltFSAttr (addition)
gestaltHasFileSystemManager = 2; *2
****'font' (System)
gestaltFontMgrAttr (addition)
additional System 7.1 responses exist but unknown
****'hdwr' (System)
gestaltHardwareAttr (additions)
gestaltHasRBV = 2; (RBV) *3
gestaltHasOSS = 5; (OSS) *3
gestaltHasSCSIDMA = 6; (53C80 SCSI DMA) *3
gestaltHasSWIMIOP = 8; (SWIM IOP) *3
gestaltHasSCCIOP = 9; (SCC IOP) *3
gestaltHasIWM = 11; (IWM) *3
gestaltHasSoftPowerOff = 19; *2
gestaltHasSonic = 20; (Sonic) *3
gestaltHasSCSI961 = 21; (Int. 53C96 SCSI) *1
gestaltHasSCSI962 = 22; (Ext. 53C96 SCSI) *1
gestaltHasDAFBVideo = 23; (DAFB Video) *3
****'He20' (Helium cp)
unknown
****'hgfd' (AppleShare File Server appl [since v3.0?])
gestaltASFileServerAttr (not listed in IM VI)
gestaltASFileServer = 'hgfd';
gestaltASFileServerPresent = 0; (present = running, selector
exists when appl has ran,
if still running bit is set)
****'icmp' (QuickTime ext)
unknown
****'Intj' (Interjection ext)
unknown
****'kbd ' (System)
gestaltKeyboardType (additions)
gestaltPwrBookADBKbd = 12; *1
gestaltPwrBookISOADBKbd = 13; *1
****'mach' (System)
gestaltMachineType (additions)
gestaltQuadra900 = 20; *1
gestaltPowerBook170 = 21; *1
gestaltQuadra700 = 22; *1
gestaltClassicII = 23; *1
gestaltPowerBook100 = 24; *1
gestaltPowerBook140 = 25; *1
gestaltQuadra950 = 26; *1
gestaltPowerBook210 = 29;
gestaltPowerBook230 = 32;
gestaltPowerBook180 = 33;
gestaltPowerBook160 = 34;
gestaltMacLCII = 37;
gestaltMacIIvi = 44;
gestaltPerforma600 = 45;
gestaltMacIIvx = 48;
gestaltPowerBook145 = 54;
contradiction:
Dev.Note PwrBk145 says "gestaltPowerBook145 = 25; with sys 7.0.x and
gestaltPowerBook145 = 45; with sys 7.1"
According M.Johnson "gestaltPowerBook145 = 54;"
****'mtcp' (MacTCP cp [since v1.1?])
returns noErr when present, return value is zero.
****'mmu ' (System)
gestaltMMUType (addition)
gestalt68040MMU = 4; *2
****'MV10' (TearOFF cp)
unknown
****'ppc ' (System)
gestaltPPCToolboxAttr
gestaltPPCToolbox = 'ppc '
gestaltPPCToolboxDenyIn = 0; (Deny incoming net requests) *3
gestaltPPCToolboxDenyOut = 1; (Deny outgoing net requests) *3
gestaltPPCToolboxRTDeliv = 12; (supports real-time delivery) *3
gestaltPPCToolboxStore = 13; (supports store and format) *3
gestaltPPCToolboxCare = 14; (supports "Don't care") *3
contradiction:
TN129 says "gestaltPPCToolboxPresent = 0;"
GestaltDA says "gestaltPPCToolboxDenyIn = 0;"
****'proc' (System)
gestaltProcessorType (addition)
gestalt68040 = 5; *2
****'qdrw' (System)
gestaltQuickDrawFeaturesAttr (not listed in IM VI)
gestaltQuickDrawFeatures = 'qdrw'; *2
gestaltHasColor = 0; *2
gestaltHasDeepGWorlds = 1; *2
gestaltHasDirectPixMaps = 2; *2
gestaltHasGrayishTextOr = 3; *2
****'qtim' (QuickTime ext)
gestaltQuickTimeVersion
Returns QuickTime version in 4-byte words
gestaltQuickTimeVersion = 'qtim';
****'rsrc' (System)
gestaltResourceMgrAttr (addition)
gestaltResourceMgr???? = 1;
****'tabl' (System)
gestaltSelectorTable
Returns the address of the Gestalt selector table itself.
gestaltSelectorTable = 'tabl';
****'tsmv' (System)
gestaltTextServicesMgrVersion? (not listed in IM VI)
gestaltTextServicesMgr = 'tsmv';
new System 7.1 responses exist but unknown
****'vmcl' (System, VM on)
unknown.
****'vmbs' (System, VM on)
unknown.
****'wma.' (System)
gestaltResponderAttr (Workstation Management Agent aka Responder,
not listed in IM VI)
gestaltResponder = 'wma.';
gestaltResponderPresent = 0;
****'xttt' (System)
gestaltExtToolboxTable
Returns the base address of the Extended Toolbox trap table.
****'YeHa' (SpeedyFinder7 cp)
unknown
####Abbreviations:
appl - application
cp - control panel
ext - extension
ADB - Apple Desktop Bus
AS - AppleShare
ASC - Apple Sound Chip
CPU - Central Processing Unit
DAFB - ?
DMA - ?
FPU - Floating Point Unit
IOP - Input/Output Processor
IWM - Integrated Woz Machine
MMU - Memory Management Unit
OSS - ?
PPC - Program-to-Program Communication
RBV - ?
SCC - Serial Communications Controller
SCSI - Small Computer System Interface
SIMM - Single In-line Memory Module
Sonic - ?
SWIM - Super Integrated Woz Machine
TN - Technical Note
VIA - Versatile Interface Adapter
VM - Virtual Memory
####Format 4-byte word version number:
The format of the LONGINT result is as follows:
byte; /* Major revision */
byte; /* Minor revision */
byte development = 0x20, /* Release stage */
alpha = 0x40,
beta = 0x60,
final = 0x80, /* or */ release = 0x80;
byte; /* Non-final release # */
####Sources:
*1 Apple Inc.; TN129 May 1987, rev. May 1992
*2 Symantec Corp.; THINK Pascal 4.0.1
*3 Gestalt DA by Carl C.Hewitt, 1990
*4 Apple Inc.; Developer Notes PowerBook 145
- Apple Inc.; TN311 April 1992, rev. May 1992
If no source mentioned, found by myself or others.
All trade names referenced are the trademark or registered
trademark of their respective holder.
####Thanks to:
Cor Stoof <sjoukje@bio.vu.nl> (NL),
John van Wielink <vwielink@bio.vu.nl> (NL),
Lawrence D'Oliveiro <ldo@waikato.ac.nz> (NZ)
Marco Piovanelli <piovanel@pluto.sm.dsi.unimi.it> (IT),
Mark B. Johnson <mjohnson@Apple.com> (USA),
Quinn <quinn@cs.uwa.edu.au> (AU).
These persons supplied information used in this list. They did this
on personal title, NOT on behalf of their employer.
####Moderator:
Rene G.A. Ros (student Computer Science)
D.C. van Krimpenstraat 3
1067 SG Amsterdam, The Netherlands
Phone# : +31 20 611 92 74 / +31 20 611 87 00
Fax# : +31 20 611 60 06
Internet : rgaros@bio.vu.nl
rgaros@nikhefk.nikhef.nl
CompuServe: 100112,1363 (not prefered)
>INTERNET:rgaros@bio.vu.nl
* An earlier posted list had 'Undocumented' as part of the title.
As I understood, this means to most of you something different
to what my Dutch-English dictionary says. My apologies.
English is not my native tongue, you see...
************************************************************
Rene G.A. Ros Amsterdam, Netherlands
rgaros@bio.vu.nl rgaros@nikhefk.nikhef.nl
************************************************************
My English is niet very well en ook nog not so snel,
but that comes later wel.
************************************************************
---------------------------
From: rgaros@bio.vu.nl (Rene G.A. Ros)
Subject: Undoc. gestalt selector list
Date: 12 Oct 92 12:13:27 GMT
Organization: VU Biology, Amsterdam, The Netherlands
Undocumented Gestalt Selector Codes
'Undocumented' means to me: not mentioned in Inside Macintosh VI.
Format used:
****'selector code' (Application added selector)
name (description, documentation) OR description
CONST declaration; (remark) *ref.number to source
Some constant-names may not originate from official publications.
Any bitpattern described is what I or others found
on their machine with their configuration.
I don't have all the documentation or knowledge and I don't want to.
I would like to see this list as a combined effort by different
people who have together access to a wide area of information.
If you wish to give me more information or correct the information
in this list, please mail me at rgaros@bio.vu.nl
If you read this list in Usenet group comp.sys.mac.programmer: you
can also read it by using finger to the same address.
Tip: finger rgaros@bio.vu.nl | more
****'admn' (AppleShare Admin appl)
gestaltAppleShareAdminAttr (not documented at all)
gestaltAppleShareAdmin = 'admn';
gestaltAppleShareAdminPresent = 0; (present = running, selector
exists when appl has ran,
if still running bit is set)
****'atkv' (System)
gestaltATalkVersion (see also TN311)
Returns AppleTalk version in 4-bit words
gestaltATalkVersion = 'atkv'; *3
****'AzNe' (NameView cdev)
unknown
****'BSDa' (CloseView cdev)
unknown
****'bugz' (System [Tuna Helper]/Tune-up ext)
probably used to communicate between the Tuna Helper
and the Tune-up extension about repaired errors.
The value returned by 1.1.1 is one bit set more
then 1.0.
****'conn' (System)
gestaltConnMgrAttr (addition)
additional responses exist but unknown (bit 1,2,3)
****'cpnt' (QuickTime)
gestaltComponentMgrAttr (Component Manager)
gestaltComponentMgr = 'cpnt';
gestaltComponentMgrPresent = 0; ???
****'dict' (System)
gestaltDictionaryMgr (System 7.1 Dictionary Manager,
not documented at all)
gestaltDictionaryMgr = 'dict';
new System 7.1 responses exist but unknown
****'eajt' (System)
gestaltEasyAccessJTable (not documented at all)
gestaltEasyAccessJ = 'eajt'; *3
Returns the base address of the Easy Access jump-trap table
****'ESOC' (Serial of Champions ext)
unknown
****'flag' (Network Extension ext)
gestaltFlagshipAttr (not documented at all, see also TN311)
gestaltFlagship = 'flag'; *3
gestaltFlagshipPresent = 0; *3
gestaltFlagshipRegistered = 1; *3
****'fpu ' (System)
gestaltFPUType (addition)
gestal68040FPU = 3; *2
****'fs ' (System)
gestaltFSAttr (addition)
gestaltHasFileSystemManager = 2; *2
****'font' (System)
gestaltFontMgrAttr (addition)
additional System 7.1 responses exist but unknown
****'hdwr' (System)
gestaltHardwareAttr (additions)
gestaltHasRBV = 2; (RBV) *3
gestaltHasOSS = 5; (OSS) *3
gestaltHasSCSIDMA = 6; (53C80 SCSI DMA) *3
gestaltHasSWIMIOP = 8; (SWIM IOP) *3
gestaltHasSCCIOP = 9; (SCSI IOP) *3
gestaltHasIWM = 11; (IWM) *3
gestaltHasSoftPowerOff = 19; *2
gestaltHasSonic = 20; (Sonic) *3
gestaltHasSCSI961 = 21; (Int 53C96 SCSI) *1
gestaltHasSCSI962 = 22; (Ext 53C96 SCSI) *1
gestaltHasDAFBVideo = 23; (DAFB Video) *3
****'He20' (Helium cdev)
unknown
****'hgfd' (AppleShare File Server appl)
gestaltAppleShareFServerAttr (not documented at all)
gestaltAppleShareFServer = 'hgfd';
gestaltAppleShareFServerPresent = 0; (present = running, selector
exists when appl has ran,
if still running bit is set)
****'icmp' (System?)
unknown ("integrated circuit map"?????)
below is what I guess at this moment:
gestaltSIMMICPresent = 'icmp'
gestaltSIMMICBankA1 = 0; (First two SIMMs in Bank A)
gestaltSIMMICBankA2 = 1; (Last two SIMMs in Bank A)
gestaltSIMMICBankB1 = 2; (First two SIMMs in Bank B)
gestaltSIMMICBankB2 = 3; (Last two SIMMs in Bank B)
etc. ... ???
****'Intj' (Interjection ext)
unknown
****'kbd ' (System)
gestaltKeyboardType (additions)
gestaltPwrBookADBKbd = 12; *1
gestaltPwrBookISOADBKbd = 13; *1
****'mach' (System)
gestaltMachineType (additions)
gestaltQuadra900 = 20; *1
gestaltPowerBook170 = 21; *1
gestaltQuadra700 = 22; *1
gestaltClassicII = 23; *1
gestaltPowerBook100 = 24; *1
gestaltPowerBook140 = 25; *1
gestaltQuadra950 = 26; *1
gestaltPowerBook145 = 45; (7.1, with 7.0.1 = 25) *4
****'mtcp' (MacTCP [>=1.1?] cdev)
returns noErr when present, return value is zero.
****'mmu ' (System)
gestaltMMUType (addition)
gestalt68040MMU = 4; *2
****'MV10' (TearOFF cdev)
unknown
****'ppc ' (System)
gestaltPPCToolboxAttr
gestaltPPCToolbox = 'ppc '
gestaltPPCToolboxDenyIn = 0; (Deny incoming net requests) *3
gestaltPPCToolboxDenyOut = 1; (Deny outgoing net requests) *3
gestaltPPCToolboxRTDeliv = 12; (supports real-time delivery) *3
gestaltPPCToolboxStore = 13; (supports store and format) *3
gestaltPPCToolboxCare = 14; (supports "Don't care") *3
contradiction: TN129 says "gestaltPPCToolboxPresent = 0;"
GestaltDA says "gestaltPPCToolboxDenyIn = 0;"
****'proc' (System)
gestaltProcessorType (addition)
gestalt68040 = 5; *2
****'qdrw' (System)
gestaltQuickDrawFeaturesAttr (not documented at all)
gestaltQuickDrawFeatures = 'qdrw'; *2
gestaltHasColor = 0; *2
gestaltHasDeepGWorlds = 1; *2
gestaltHasDirectPixMaps = 2; *2
gestaltHasGrayishTextOr = 3; *2
****'qtim' (QuickTime ext)
gestaltQuickTimeVersion
Returns QuickTime version in 4-bit words
gestaltQuickTimeVersion = 'qtim';
****'rsrc' (System)
gestaltResourceMgrAttr (addition)
gestaltResource???? = 1;
****'tsmv' (System)
gestaltTextServicesMgrVersion? (not documented at all)
new System 7.1 responses exist but unknown
****'vmcl' (System, VM on)
unknown.
****'vmbs' (System, VM on)
unknown.
****'wma.' (Workstation Management Agent aka Responder)
gestaltResponderAttr (see also TN311)
gestaltResponder = 'wma.';
gestaltResponderPresent = 0;
****'xttt' (System)
gestaltExtToolboxTable
Returns the base address of the Extended Toolbox trap table.
****'YeHa' (SpeedyFinder7 cdev)
unknown
Sources:
*1 Apple Inc.; TN129 may 1987;
*2 THINK Pascal 4.0.1;
*3 Gestalt DA by Carl C.Hewitt, 1990
*4 Apple Inc.; Developer Notes PowerBook 145
If no source mentioned, found by myself or others.
Thanks to:
Marco Piovanelli (IT),
John van Wielink <vwielink@bio.vu.nl> (NL),
Cor Stoof <sjoukje@bio.vu.nl> (NL),
Quinn <quinn@cs.uwa.edu.au> (AU).
************************************************************
Rene G.A. Ros Amsterdam, Netherlands
rgaros@bio.vu.nl rgaros@nikhefk.nikhef.nl
************************************************************
My English is niet very well en ook nog not so snel,
but that comes later wel.
************************************************************
+++++++++++++++++++++++++++
From: ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
Date: 20 Oct 92 18:09:23 +1300
Organization: University of Waikato, Hamilton, New Zealand
In article <1992Oct12.121327.2631@bio.vu.nl>, rgaros@bio.vu.nl (Rene G.A. Ros)
lists a whole bunch of undocumented Gestalt selector codes.
Interesting. I shall be saving that list. However, you haven't included the
'tabl' selector, which returns the address of the Gestalt selector table
itself. This is what Carl Hewitt's GestaltDA uses to produce its list of
selectors.
Lawrence D'Oliveiro fone: +64-7-856-2889
Computer Services Dept fax: +64-7-838-4066
University of Waikato electric mail: ldo@waikato.ac.nz
Hamilton, New Zealand 37^ 47' 26" S, 175^ 19' 7" E, GMT+13:00
User-centered design fails miserably when users no longer feel centered.
-- Bruce Tognazzini, "Tog on Interface"
---------------------------
From: andi@uni-paderborn.de (Andreas Sorgatz)
Subject: Code-Resources
Date: 12 Oct 92 18:32:18 GMT
Organization: Uni-GH Paderborn, Germany
Hi,
anybody there, having experince with executing code-resources ?
My problem:
I want to generate a ResourceFile with a code-resource in it
(from C, for example with Think-C), in order to open and exe-
cute it from and within another program.
I could'nt find any Information on it in 'Macintosh-Inside'
and got my only information from the 'Macintosh Technical Note'
#256:Stand-Alone Code (July'92). There's an example of using
resource type 'XCMD' (used by HyperCard) under PASCAL, but all
my trying to program this in C failed.
So, please please is there anybody who can help me, having
experince with it and/or can tell me where I have to look and
what I have to read for further information ?
Thanx in advance
- ---------------------------------------------------------------
Andreas Sorgatz Uni-Paderborn, Germany
andi@uni-paderborn.de
- ---------------------------------------------------------------
+++++++++++++++++++++++++++
From: kamprath@space-grant.sprl.umich.edu (Michael F. Kamprath)
Date: 13 Oct 92 03:02:55 GMT
Organization: University of Michigan, Aerospace Engineering
In article <1992Oct12.193218@uni-paderborn.de> Andreas Sorgatz, andi@uni-paderborn.de writes:
>My problem:
>
>I want to generate a ResourceFile with a code-resource in it
>(from C, for example with Think-C), in order to open and exe-
>cute it from and within another program.
>
.
.
.
>
>So, please please is there anybody who can help me, having
>experince with it and/or can tell me where I have to look and
>what I have to read for further information ?
>
>Thanx in advance
>
I ask this very same question a while back . . . and now its my turn to
answer :-)
Basically you just load it, cast it, then use it. Oh, of course, you have
first got to write it. Let's say you are writing a mathmatical function that
get's two double's passed and returns one value. You would then write then
code for the code-resource in the form:
double main(double x, double y)
{
.
.
.
}
Once you've got it written, you need to include libraries. If you use ANSI,
use the ANSI-A4 library (has to do with addressing schemes I don't fully
understand), and compile it all as a CODE resource (see THICK C manual).
Then to use it in a program:
main()
{
double (**myFuncHandle)(double x, double y);
double xx,yy,z;
.
.
.
myFuncHandle = GetResource('PROC',128); //resource type and number arbitary
HLock(myFuncHandle);
.
.
.
z = (*myFuncHandle)(xx,yy);
.
.
.
HUnlock(myFuncHandle);
ReleaseResource(myFuncHandle);
}
Oh, I forgot to say, if you are writing a math type code resource, you'll
have to recompile ANSI-A4 so that it includes the math files from ANSI.
Currently, it doesn't (at least mine didn't).
========================================================================
| Michael F. Kamprath | The University of Michigan |
| kamprath@space-grant.sprl.umich.edu | Aerospace Engineering |
| kamprath@engin.umich.edu | Graduate Student |
+---------------------------------------+------------------------------+
| This country is a _democracy_. It is NOT a "Two Party Sytem." DO |
| NOT believe The Lie that not voting Republican or Democratic will |
| waste your vote. Vote for who ever you please, and let the |
| politicians find out what a democratic republic is all about. |
========================================================================
+++++++++++++++++++++++++++
From: rhorn@csws2.ic.sunysb.edu (Robert Horn)
Organization: State University of New York at Stony Brook
Date: Sun, 18 Oct 1992 19:13:45 GMT
In article <1992Oct12.193218@uni-paderborn.de> andi@uni-paderborn.de (Andreas Sorgatz) writes:
>I want to generate a ResourceFile with a code-resource in it
>(from C, for example with Think-C), in order to open and exe-
>cute it from and within another program.
>
>So, please please is there anybody who can help me, having
>experince with it and/or can tell me where I have to look and
>what I have to read for further information ?
>
Off the top of my head, it can quickly be done by...
- ---begin Blef.h---
#pragma once
#define rsrcTypeBlef 'blef'
#define rsrcIdMyBlef 1
typedef struct BlefPBRec BlefPBRec, *BlefPBPtr;
// pointer to pointer to function
typedef pascal OSErr (**BlefHandle)(BlefPBPtr);
struct BlefPBRec {
// your stuff here
};
- --- end Blef.h ---
in project a.<pi> add and compile:
- ---MyBlef.c---
#include "Blef.h"
pascal OSErr main(BlefPBPtr *pb) {
Handle myself;
SignedByte state;
OSErr theErr;
// get a handle to your code resource
// Think has something with A0 as well,
// but this requires no inline assembly
myself = RecoverHandle((Ptr) main);
if(myself == NULL) {
return memWZErr; // your favorite error here
}
// get you current state, and lock yourself
// it would be bad if your code moves out
// from under you.
state = HGetState(myself);
HLock(myself);
// fiddle with your BlefPBPtr, do whatever your code resource
// is supposed to do... SysBeep(7) or something.
// restore your state
HSetState(myself, state);
return theErr;
}
- --- end MyBlef.c ---
set the project's type to be a code resource of type 'blef' and ID 1
set whatever other options you feel are appropiate (system, locked...)
Choose build code resource, and save a file entitled "b.<pi>.rsrc"
Create a project named "b.<pi>"
add the following to it...
- --- begin CallBlef.c---
#include "blef.h"
main() {
BlefHandle hBlef;
BlefPBRec pb;
OSErr theErr;
// normal toolbox init
...
// get your resource, which should be there
// since think C will use any file named
// "your project name".rsrc as the app's
// resource file.
hBlef = (BlefHandle) GetResource(rsrcTypeBlef, rsrcIdMyBlef);
// check for it just not being there, or out of mem
// DoError should handle the error condition, or just
// ExitToShell() until you get around to implementing
// it.
if(!hBlef) DoError();
// set up your pb
// call your code resource
theErr = (**hBlef)(&pb);
// release the resource when you're done with it
ReleaseResource((Handle) hBlef);
...
}
- --- end CallBlef.c ---
- --
rhorn@ic.sunysb.edu Never choose a college because it has a duckpond.
Would you like to touch my wombat? Send me hate mail, I love it.
---------------------------
From: stud08@cc4.kuleuven.ac.be (Karl Pottie)
Date: Monday, 19 Oct 1992 22:46:51 +01
Organization: K.U.Leuven - Academic Computing Center
Subject: 'sysz' resource
I've been looking for info on the 'sysz' resource. IM or the technotes
don't seem to contain any info on how or when to use the sysz resource.
If I'm right, the resource contains a longword which "reserves" an
amount of memory in the system heap for my init. But do I need to use
a sysz if my init only uses e.g. 3Kb of RAM ?
Could anybody end my quest and point me to valid info on the sysz resource ?
I'd like to know everything there is to know about this resource.
+++++++++++++++++++++++++++
From: jpugh@apple.com (Jon Pugh)
Date: 20 Oct 92 02:37:04 GMT
Organization: Apple Computer, Inc.
In article <1992Oct19.224148@cc4.kuleuven.ac.be>, stud08@cc4.kuleuven.ac.be
(Karl Pottie) wrote:
>
> I've been looking for info on the 'sysz' resource. IM or the technotes
> don't seem to contain any info on how or when to use the sysz resource.
> If I'm right, the resource contains a longword which "reserves" an
> amount of memory in the system heap for my init. But do I need to use
> a sysz if my init only uses e.g. 3Kb of RAM ?
> Could anybody end my quest and point me to valid info on the sysz resource ?
> I'd like to know everything there is to know about this resource.
That's all there is. You should always include a sysz resource in case you
are approaching the end of the system heap space. The System checks the
free space in the heap and compares that to the sysz amount and if the heap
is smaller then it grows the heap so that there is enough room. I believe
that the System is free to grow the heap any amount it feels like, so there
should always be more room than your sysz requests.
You don't need one, because in a 3K INIT you are less likely to run into a
situation where the System heap doesn't have at least 3K available, but you
_should_ have one. Just in case.
Jon
+++++++++++++++++++++++++++
From: nerm@apple.com (Dean Yu)
Date: 20 Oct 92 17:32:26 GMT
Organization: Apple Computer, Inc.
In article <jpugh-191092193029@90.20.3.201>, jpugh@apple.com (Jon Pugh)
wrote:
>
> In article <1992Oct19.224148@cc4.kuleuven.ac.be>, stud08@cc4.kuleuven.ac.be
> (Karl Pottie) wrote:
> >
> > I've been looking for info on the 'sysz' resource. IM or the technotes
> > don't seem to contain any info on how or when to use the sysz resource.
> > If I'm right, the resource contains a longword which "reserves" an
> > amount of memory in the system heap for my init. But do I need to use
> > a sysz if my init only uses e.g. 3Kb of RAM ?
> > Could anybody end my quest and point me to valid info on the sysz resource ?
> > I'd like to know everything there is to know about this resource.
>
> That's all there is. You should always include a sysz resource in case you
> are approaching the end of the system heap space. The System checks the
> free space in the heap and compares that to the sysz amount and if the heap
> is smaller then it grows the heap so that there is enough room. I believe
> that the System is free to grow the heap any amount it feels like, so there
> should always be more room than your sysz requests.
>
> You don't need one, because in a 3K INIT you are less likely to run into a
> situation where the System heap doesn't have at least 3K available, but you
> _should_ have one. Just in case.
>
> Jon
Currently, the startup code guarantees 24K of heap space (not necessarily
contiguous) for INITs. (I think it used to be 16K on older systems.) If
you need less than that, you don't need to include a 'sysz' resource. If
you need more, include a 'sysz' 0 resource. Keep in mind that this is
memory available to your INIT at the time your INIT is loaded, and may not
necessarily be around later on down the road.
- -- Dean Yu
Blue Meanie, Negative Ethnic Role Model, etc.
Apple Computer, Inc.
---------------------------
From: ajr3@quads.uchicago.edu (Alain Roy)
Subject: Problem w/ Sys7 Popup Menus
Date: 19 Oct 92 13:09:11 GMT
Organization: University of Chicago Computing Organizations
Hello. I have a small program in which i use the new System 7 popup
menus. Oddly enough, the arrow in the box sometimes turns grey after
selecting an item in the menu. As far as I can tell, my code is correct.
Has anyone seen this behavior before?
Thanx in advance for any help.
Alain Roy
ajr3@midway.uchicago.edu
+++++++++++++++++++++++++++
From: alexr@apple.com (Alexander M. Rosenberg)
Date: 20 Oct 92 20:17:42 GMT
Organization: Hackers Anonymous
In article <1992Oct19.130911.21937@midway.uchicago.edu> Alain Roy,
ajr3@quads.uchicago.edu writes:
>Hello. I have a small program in which i use the new System 7 popup
>menus. Oddly enough, the arrow in the box sometimes turns grey after
>selecting an item in the menu. As far as I can tell, my code is correct.
>Has anyone seen this behavior before?
Selecting an item numbered higher than 31 causes this. It will be corrected
in an future system software release.
- ---------------------------------------------------------------------------
- - Alexander M. Rosenberg - INTERNET: alexr@apple.com - Yoyodyne -
- - 330 Waverley St., Apt B - UUCP:ucbvax!apple!alexr - Propulsion -
- - Palo Alto, CA 94301 - - Systems -
- - (415) 329-8463 - Nobody is my employer so - :-) -
- - (408) 974-3110 - nobody cares what I say. - -
---------------------------
From: scott@mcl.ucsb.edu (Scott Bronson)
Subject: Registering Gestalt Selectors
Date: 20 Oct 92 15:30:32 GMT
I sent in a registration request for an INIT/cdev combo that I just
finished, asking if it was possible to register Gestalt selectors
too. My file type/creator came back without a hitch, but they
totally ignored my question.
Does anyone know? It seems like good practice to use Gestalt to get
at my globals in the System heap, but only if there is some sort of
standard to ensure no conflicts will happen.
- Scott
+++++++++++++++++++++++++++
From: absurd@applelink.apple.com (Tim Dierks, software saboteur)
Date: 20 Oct 92 18:36:38 GMT
Organization: MacDTS Marauders
In article <scott.719595032@mcl>, scott@mcl.ucsb.edu (Scott Bronson) wrote:
>
> I sent in a registration request for an INIT/cdev combo that I just
> finished, asking if it was possible to register Gestalt selectors
> too. My file type/creator came back without a hitch, but they
> totally ignored my question.
>
> Does anyone know? It seems like good practice to use Gestalt to get
> at my globals in the System heap, but only if there is some sort of
> standard to ensure no conflicts will happen.
>
> - Scott
The usual practice is to use your creator. As it says in Inside Mac VI,
page 3-42, "If you have registered a creator string with Apple, you are
strongly encouraged to use that sequence as your selector code." If
everyone follows this rule, we won't have any conflicts. For extra
safety, register an extremely obscure creator code and use it as your
selector.
Tim Dierks
MacDTS, but I speak for my knees.
+++++++++++++++++++++++++++
From: grobbins@Apple.COM (Grobbins)
Date: 22 Oct 92 08:29:53 GMT
Organization: Weird Future Computer Dept.
In article <scott.719595032@mcl> scott@mcl.ucsb.edu (Scott Bronson) writes:
>I sent in a registration request for an INIT/cdev combo that I just
>finished, asking if it was possible to register Gestalt selectors
>too. My file type/creator came back without a hitch, but they
>totally ignored my question.
Sorry 'bout that. So many creator/file type requests come in that they
more or less have to be handled by someone running on autopilot.
Gestalt selectors are not registered by Apple. A reasonable convention
is to use your creator type for your selector. If you need more than
one, pick something obscure, like a code with option characters in
it. Be sure to include an upper case character since Apple generally
reserves codes without upper case characters in them.
>Does anyone know? It seems like good practice to use Gestalt to get
>at my globals in the System heap, but only if there is some sort of
>standard to ensure no conflicts will happen.
Gestalt really isn't intended to be used for sharing memory blocks....
Grobbins grobbins@apple.com
Usual disclaimers apply.
---------------------------
From: lward@husc8.harvard.edu (Lester Ward)
Subject: RTF format?
Date: 14 Oct 92 17:51:13 GMT
Is the Rich Text Format (RTF) file format public? And if it is, where
might I find documentation on it?
Thanks,
Wordman
lward@husc.harvard.edu
+++++++++++++++++++++++++++
From: gilbertd@sunflower.bio.indiana.edu (Don Gilbert)
Organization: Biology, Indiana University - Bloomington
Date: Thu, 15 Oct 1992 04:25:36 GMT
Paul Dubois seems to be waging a one-programmer campaign for rtf.
I haven't seen any public rtf utilities from others, which may be
a shame -- rtf is beginning to look to me like one of the best
inter-platform document formats. The commonest Mac and PC worders
all deal with it, and you can find it on unix systems.
You can find Paul Dubois' rtf2other converter, his new
troff2rtf converter, plus various rtf docs including one from Microsoft
specifying the format: anon. ftp to ftp.primate.wisc.edu, look in
/pub/RTF, and /pub/troffcvt if you want to move troff to rtf.
- -- don
- --
Don Gilbert gilbert@bio.indiana.edu
biocomputing office, biology dept., indiana univ., bloomington, in 47405
+++++++++++++++++++++++++++
From: bwilliam@iat.holonet.net (Bill Williams)
Organization: HoloNet (BBS: 510-704-1058)
Date: Sat, 17 Oct 1992 08:03:46 GMT
NeXT distributes a RTF Spec. The tech reference for MS Word gurus
describes it also (a MS published book found in bookstores once)
Bill Williams
+++++++++++++++++++++++++++
From: sro@media.mit.edu (Shawn O'Donnell)
Date: 22 Oct 92 04:20:15 GMT
Organization: M.I.T. Media Laboratory
I, too, think RTF is pretty cool. And I'll make a prediction for you:
in the future, FAXes will be digital and by RTF. No more stinkin'
low-res bit-maps. Crisp reproductions. (Except for the bit-mapped
logos and signatures...)
In any case, I found a HyperCard stack somewhere with RTF stuff in it.
It's called "Styled->RTF." In the information field, there is the
following passage:
> Write the source for definitive info about the Rich Text Format
> Specification:
>
> Microsoft Corporation
> RTF/Applications
> 16011 NE 36th Way
> Box 97017
> Redmond, WA 98073-9717
>
> I almost forgot the disclaimer: my application of the RTF
> specification uses a limited subset of its available features. It is
> intended as an exercise for YOU to use this code to do more, if you
> wish, and it's reccomended that you first obtain the information from
> the address above.
>
> Anyway, I'd like to know if (and then, how) you have found this useful.
> Please send me your comments.
>
> Chuck Kuske
> AppleLink: KUSKE1
> AOL: ElvisLives
>
> February 20, 1991
RTF may or may not be a public domain kind of thing--from what I know about
the Microsoft people, they'll probably haul all of our asses into court for
deigning to mention the letters "RTF" without citing the trademark.
On the other hand, their lawyers could have been sleeping one day and
let the engineers do something nice for the computer world. You'll
have to ask them. And let us all know--from home or jail--if there's
some sort of copyright on RTF-style formats.
I'm having trouble figuring out how they could stop you from
reverse-engineering the format, but then I'm not a lawyer, am I?
- --Shawn
---------------------------
Subject: Changing open resource files
From: greg@huia.canterbury.ac.nz (Greg Ewing)
Date: Wed, 21 Oct 1992 04:25:47 GMT
Organization: University of Canterbury, Christchurch, New Zealand
I'm writing an application that creates and edits resources for use by
another application (not written by me). Rather than stuff the resources
into the application itself, which seems a kludgy thing to do, I'm
putting them in a separate file and opening it with Suitcase.
The problem is that to test the created resources requires going
through an elaborate save/open file with suitcase/launch application/
try it out/quit application/close file in suitcase/open file with editor
loop, which becomes very tedious!
So, I'm wondering whether I can change the resource file while Suitcase
has it open. Attempts at doing this so far have had results ranging from
apparent success, through various combinations of Suitcase/my editor
being unable to open the file because it's busy, to system crashes.
Is there any safe way of doing it? If I test whether the resource
file is already open, and don't close it afterwards if it was,
I could at least avoid closing the resource file out from under
Suitcase (which seemed to be one source of problems).
Would that be sufficient? If so, how do I test whether a resource
file is open? There doesn't seem to be any obvious way of doing
this, although ResEdit seems to manage it somehow. ResEdit also seems
to be able to edit open System files, albeit with a danger warning,
suggesting that with care it is possible to do what I want.
Any help appreciated,
Greg Ewing, Computer Science Dept, Canterbury Univ., Christchurch, New Zealand
Internet: greg@cosc.canterbury.ac.nz +--------------------------------------
Spearnet: greg@nz.ac.canterbury.cosc | A citizen of NewZealandCorp, a
Telecom: +64 3 667 001 x6367 | wholly-owned subsidiary of Japan Inc.
+++++++++++++++++++++++++++
From: ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
Date: 22 Oct 92 09:05:24 +1300
Organization: University of Waikato, Hamilton, New Zealand
In article <BwGEz0.MMn@cantua.canterbury.ac.nz>, greg@huia.canterbury.ac.nz (Greg Ewing) writes:
>
> So, I'm wondering whether I can change the resource file while Suitcase
> has it open. Attempts at doing this so far have had results ranging from
> apparent success, through various combinations of Suitcase/my editor
> being unable to open the file because it's busy, to system crashes.
>
> Is there any safe way of doing it? If I test whether the resource
> file is already open, and don't close it afterwards if it was,
> I could at least avoid closing the resource file out from under
> Suitcase (which seemed to be one source of problems).
I've never actually used Suitcase, but I gather it opens those resource
files and puts them *behind* the System file in the resource map chain, to
make those resources look like they're in the system file.
If my understanding of how Suitcase works is correct, then you should be able
to do what you want to do.
>
> Would that be sufficient? If so, how do I test whether a resource
> file is open? There doesn't seem to be any obvious way of doing
> this, although ResEdit seems to manage it somehow. ResEdit also seems
> to be able to edit open System files, albeit with a danger warning,
> suggesting that with care it is possible to do what I want.
Funnily enough, there was a discussion about this in this newsgroup just a
few weeks ago. The basic technique is quite simple: check the value of
the TopMapHndl low-memory global before and after opening the resource file.
If it changes, then a new resource map has been added to the chain, which
means the resource file wasn't previously open. If it doesn't change, you've
just reopened a previously-open resource file.
Lawrence D'Oliveiro fone: +64-7-856-2889
Computer Services Dept fax: +64-7-838-4066
University of Waikato electric mail: ldo@waikato.ac.nz
Hamilton, New Zealand 37^ 47' 26" S, 175^ 19' 7" E, GMT+13:00
One does not design a human interface based on the fact that 3-D interfaces
look "real cool". One only has to sit in virtually any of the "real cool"
chairs built in the last fifty years by leading Bauhaus designers to understand
why: what looks "real cool" can often be acutely painful to use. First, the
interface should communicate; only then should it look "real cool".
-- Bruce Tognazzini, "Tog on Interface"
---------------------------
End of C.S.M.P. Digest
**********************